package com.example.indenture.user.service;

import com.example.indenture.common.vo.Result;
import com.example.indenture.common.vo.Search;
import com.example.indenture.user.entity.User;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpSession;

@Service
public interface UserService {

    Result<User> insertUser(User user,HttpSession httpSession);

    Result<Object> deleteUserById(int id);

    Result<Object> updateUser(User user);

    @Transactional
    Result<User> loginInUser(String username, String password, HttpSession httpSession);

    @Transactional
    Result<User> loginByUserFace(String username, String validPhoto, HttpSession httpSession) throws Exception;

    Result<Object> updateUserUrl(int id, String url);

    PageInfo<User> getUsersBySearch(Search search);

    Result<Integer> getIdByName(String keyword);
    User getUseById(Integer id);
    
}
